package com.kfm.pm.generic;

import com.kfm.am.Student;

public class MyList<E> {

    Object[] arr = new Object[20];
    int count = 0;

    void add(E obj) {
        arr[count ++] = obj;
    }

     E get(int index) {
         System.out.println(index);
        return (E)arr[index];
     }


    public static void main(String[] args) {
        MyList<Student> myList = new MyList<>();
        myList.get(0);
        myList.get(1);
        MyList<String> stringMyList = new MyList<>();
        myList.add(new Student());
//        myList.add(0);
        Student student = myList.get(0);
        Object object = myList.get(0);
        Student stu = (Student) object;
        stu.test();
    }
}
